package EncryptionTools;

public class PermutationBox {
    private static final int[] P = {
            16, 7, 20, 21, 29, 12, 28, 17,
            1, 15, 23, 26, 5, 18, 31, 10,
            2, 8, 24, 14, 32, 27, 3, 9,
            19, 13, 30, 6, 22, 11, 4, 25
    };
    //Permutation Table

    public static byte[] applyPermutation(byte[] input) {
        byte[] permuted = new byte[32];
        for (int i = 0; i < P.length; i++) {
            permuted[i] = input[P[i] - 1];
        }
        return permuted;
    }
}
